package sample;

import javax.swing.*;
import java.awt.*;

public class DialogDemo extends JFrame {

    public DialogDemo() {
        this.setVisible(true);
        this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        pack();

        //Jfame放东西，容器
        Container container=new Container();
        //绝对布局
        container.setLayout(null);

        //按钮
        JButton button = new JButton("点击弹出一个对话框");
        //绝对定位
        button.setBounds(30,30,200,50);

    }
}

//弹窗的窗口

